import * as types from "../types";
import router from "../../router/index";
import { fatch } from "../../http/index";

const state = {
    menuOut: false // 菜单栏收缩展开
};

const actions = {
    loginOut({ commit }) {
        window.sessionStorage.removeItem("token");
        router.push("/login");
    }
};

const getters = {
    menuOut: state => state.menuOut
};

const mutations = {
    //菜单栏收缩展开
    [types.COM_MENU_TOGGLE](state) {
        state.menuOut = !state.menuOut;
    }
};

export default {
    state,
    actions,
    getters,
    mutations
};
